package com.listener;

import com.hustcad.plm.pdm.workflow.annotion.CustomListener;
import com.hustcad.plm.pdm.workflow.annotion.CustomListenerField;
import org.flowable.engine.delegate.TaskListener;
import org.flowable.engine.impl.el.FixedValue;
import org.flowable.task.service.delegate.DelegateTask;

@CustomListener(category = "自定义监听器", description = "测试任务监听器")
public class TestTaskListener implements TaskListener {
    @CustomListenerField(description = "测试参数1", required = true, defaultValue = "")
    private FixedValue param1;

    @Override
    public void notify(DelegateTask delegateTask) {
        //将params1传入流程变量customParams
        delegateTask.setVariable("customParams", param1);
    }
}
